import { post, get, put, Delete, form } from "@/axios/http.js";
import { basicApi } from "@/api/index.js"
// 评论
export default {
    namespaced: true,
    state: {},
    actions: {
        // 评论删除-可批量
        replyDel({ commit }, params) {
            return Delete(basicApi.comment.replyDel, params).then(res => {
                return res
            });
        },
        // 分页查询评论的回复,参数中的id为评论的id
        pageCommentlistReply({ commit }, params) {
            return post(basicApi.comment.pageCommentlistReply, params).then(res => {
                return res
            });
        },
        // 新建评论
        addGive({ commit, dispatch }, params) {
            return post(basicApi.comment.addGive, params).then(res => {
                if (res) {
                    dispatch('visitorAllModule/visitorAdd', {
                        fromuserid: params.userid,
                        visitorid: params.commentid,
                        type: params.type
                    }, { root: true })
                }
                return res
            });
        },
        // 分页查询评论列表
        pageCommentlist({ commit }, params) {
            return post(basicApi.comment.pageCommentlist, params).then(res => {
                return res
            });
        },
    },
    mutations: {},
};